package com.mall.service.order.controller;

import com.mall.commons.common.CommonResult;
import com.mall.model.domain.OmsOrderSetting;
import com.mall.service.order.service.OmsOrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/orderSetting")
public class OmsOrderSettingController {
    @Autowired
    private OmsOrderSettingService omsOrderSettingService;

    //修改订单设置
    @PostMapping("/update/{id}")
    public CommonResult updateOmsOrderSetting(@PathVariable Long id, @RequestBody OmsOrderSetting omsOrderSetting) {
        omsOrderSettingService.updateOmsOrderSetting(id, omsOrderSetting);
        return CommonResult.success(1,"修改成功");
    }

    //查询订单设置
    @GetMapping("/{id}")
    public CommonResult<OmsOrderSetting> findOmsOrderSetting(@PathVariable Long id) {
        OmsOrderSetting omsOrderSetting = omsOrderSettingService.findById(id);
        return CommonResult.success(omsOrderSetting);
    }

}
